<template>
  <div>
    <el-dialog title="修改个人信息" :visible.sync="changeStudentBaseInfoFormVisible">
      <el-form :model="changeStudentBaseInfoForm">
        <el-form-item label="姓名" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiName" autocomplete="off" :disabled="true" />
        </el-form-item>
        <el-form-item label="学号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiNumber" autocomplete="off" :disabled="true" />
        </el-form-item>
        <el-form-item v-show="false" label="性别" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiSex" autocomplete="off" :disabled="true" />
        </el-form-item>
        <el-form-item label="学院" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiAcademy" autocomplete="off" />
        </el-form-item>
        <el-form-item label="系" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiDepartment" autocomplete="off" />
        </el-form-item>
        <el-form-item label="专业" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiMajor" autocomplete="off" />
        </el-form-item>
        <el-form-item label="出生日期" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-date-picker
            v-model="changeStudentBaseInfoForm.sbiBirthdate"
            type="date"
            placeholder="选择日期"
            format="yyyy 年 MM 月 dd 日"
            value-format="yyyy-MM-ddT00:00:00.000+0000"
          />
        </el-form-item>
        <el-form-item label="民族" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiNation" autocomplete="off" />
        </el-form-item>
        <el-form-item label="前置学历" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiFormerEducation" autocomplete="off" />
        </el-form-item>
        <el-form-item label="入学方式" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiEntranceWay" autocomplete="off" />
        </el-form-item>
        <el-form-item label="入学时间（年）" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiEntranceYear" autocomplete="off" />
        </el-form-item>
        <el-form-item label="入学时间（月）" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiEntranceMonth" autocomplete="off" />
        </el-form-item>
        <el-form-item label="预计毕业时间（年）" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiPredictGraduateYear" autocomplete="off" />
        </el-form-item>
        <el-form-item label="预计毕业时间（月）" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiPredictGraduateMonth" autocomplete="off" />
        </el-form-item>
        <el-form-item label="学制" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiEducationSystem" autocomplete="off" />
        </el-form-item>
        <el-form-item label="学籍类型" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiStatusType" autocomplete="off" />
        </el-form-item>
        <el-form-item label="身份证件类型" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiIDType" autocomplete="off" />
        </el-form-item>
        <el-form-item label="身份证件号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiIDNumber" autocomplete="off" />
        </el-form-item>
        <el-form-item label="生源地国家" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input
            v-model="changeStudentBaseInfoForm.sbiSourceOfSchoolEnrollmentCountry"
            autocomplete="off"
          />
        </el-form-item>
        <el-form-item label="生源地省" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input
            v-model="changeStudentBaseInfoForm.sbiSourceOfSchoolEnrollmentProvince"
            autocomplete="off"
          />
        </el-form-item>
        <el-form-item label="生源地市" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiSourceOfSchoolEnrollmentCity" autocomplete="off" />
        </el-form-item>
        <el-form-item label="政治面貌" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiPolicyOutlook" autocomplete="off" />
        </el-form-item>
        <el-form-item label="户口所在地" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiRegisteredResidencePlace" autocomplete="off" />
        </el-form-item>
        <el-form-item label="入学前户口性质" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input
            v-model="changeStudentBaseInfoForm.sbiFormerRegisteredResidenceProperty"
            autocomplete="off"
          />
        </el-form-item>
        <el-form-item label="手机号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiCellNumber" autocomplete="off" />
        </el-form-item>
        <el-form-item label="电子信箱" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiEmail" autocomplete="off" />
        </el-form-item>
        <el-form-item label="QQ号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiQq" autocomplete="off" />
        </el-form-item>
        <el-form-item label="微信号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiWechat" autocomplete="off" />
        </el-form-item>
        <el-form-item label="校外（家庭）居住国家" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiLivingCountry" autocomplete="off" />
        </el-form-item>
        <el-form-item label="校外（家庭）居住省" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiLivingProvince" autocomplete="off" />
        </el-form-item>
        <el-form-item label="校外（家庭）居住市" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiLivingCity" autocomplete="off" />
        </el-form-item>
        <el-form-item label="校外（家庭）居住区" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiLivingDistrict" autocomplete="off" />
        </el-form-item>
        <el-form-item label="校外（家庭）居住详细地址" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiLivingDetailedAddress" autocomplete="off" />
        </el-form-item>
        <el-form-item label="家属姓名" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiRelativeName" autocomplete="off" />
        </el-form-item>
        <el-form-item label="家属联系方式" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiRelativeContract" autocomplete="off" />
        </el-form-item>
        <el-form-item label="班级" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiClass" autocomplete="off" />
        </el-form-item>
        <el-form-item label="团支部" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiYouthLeagueBranch" autocomplete="off" />
        </el-form-item>
        <el-form-item label="党支部" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiPartyBranch" autocomplete="off" />
        </el-form-item>
        <el-form-item label="导师" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiTeacher" autocomplete="off" />
        </el-form-item>
        <el-form-item label="导师工号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiTeacherNumber" autocomplete="off" />
        </el-form-item>
        <el-form-item label="班主任" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiClassTeacher" autocomplete="off" />
        </el-form-item>
        <el-form-item label="班主任工号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiClassTeacherNumber" autocomplete="off" />
        </el-form-item>
        <el-form-item label="辅导员" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiInstructor" autocomplete="off" />
        </el-form-item>
        <el-form-item label="辅导员工号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiInstructorNumber" autocomplete="off" />
        </el-form-item>
        <el-form-item label="组织员" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiOrganizer" autocomplete="off" />
        </el-form-item>
        <el-form-item label="组织员工号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiOrganizerNumber" autocomplete="off" />
        </el-form-item>
        <el-form-item label="教务员" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiDean" autocomplete="off" />
        </el-form-item>
        <el-form-item label="教务员工号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiDeanNumber" autocomplete="off" />
        </el-form-item>
        <el-form-item label="住校" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiLivingAtSchool" autocomplete="off" />
        </el-form-item>
        <el-form-item label="宿舍校区" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiDormitoryCampus" autocomplete="off" />
        </el-form-item>
        <el-form-item label="宿舍楼栋" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiDormitoryBuilding" autocomplete="off" />
        </el-form-item>
        <el-form-item label="宿舍房间号" :label-width="changeStudentBaseInfoForm.formLabelWidth">
          <el-input v-model="changeStudentBaseInfoForm.sbiDormitoryRoom" autocomplete="off" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer" style="width:auto; text-align: center;">
        <el-button type="primary" @click="changeStudentBaseInfoSubmit">修改信息</el-button>
        <el-button @click="changeStudentBaseInfoFormVisible=false">取 消</el-button>
      </div>
    </el-dialog>

    <div class="app-container" style="margin: 30px">
      <el-row>
        <el-col :span="8" style="height: 150px;">
          <div class="block" style="text-align: center; width: 100%">
            <el-avatar :size="150" :src="avatar" />
          </div>
        </el-col>
        <el-col :span="16" style="height: 150px">
          <el-row style="height: 20px">
            姓名：{{ sbiName }}
          </el-row>
          <el-row style="height: 20px">
            学号：{{ sbiNumber }}
          </el-row>
          <el-row style="height: 20px">
            性别：{{ sbiSex }}
          </el-row>
          <el-row style="height: 20px">
            学院：{{ sbiAcademy }}
          </el-row>
          <el-row style="height: 20px">
            系：{{ sbiDepartment }}
          </el-row>
          <el-row style="height: 20px">
            专业：{{ sbiMajor }}
          </el-row>
          <el-row style="height: 30px">
            <el-button type="primary" @click="changeStudentBaseInfoFormVisible=true">修改个人信息</el-button>
          </el-row>
        </el-col>
      </el-row>
    </div>
    <div class="app-container" style="margin: 30px">
      <el-table
        v-loading="loading"
        class="prize-info"
        :data="tableData"
        style="width: 100%; border-radius: 20px"
      >
        <el-table-column
          prop="type"
          width="300"
        />
        <el-table-column
          prop="info"
        />
      </el-table>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
import { getToken } from '@/utils/auth'

export default {
  data() {
    return {
      // 新加内容
      stuID: '',
      user: {},
      // 原有内容
      sbiAcademy: '',
      sbiDepartment: '',
      sbiMajor: '',
      sbiName: '',
      sbiNumber: '',
      sbiSex: '',
      loading: true,
      tableData: [],
      changeStudentBaseInfoFormVisible: false,
      changeStudentBaseInfoForm: {
        formLabelWidth: '200px',
        sbiIndex: '',
        sbiNumber: '',
        sbiName: '',
        sbiSex: '',
        sbiBirthdate: '',
        sbiNation: '',
        sbiAcademy: '',
        sbiDepartment: '',
        sbiMajor: '',
        sbiFormerEducation: '',
        sbiEntranceWay: '',
        sbiEntranceYear: '',
        sbiEntranceMonth: '',
        sbiEducationSystem: '',
        sbiPredictGraduateYear: '',
        sbiPredictGraduateMonth: '',
        sbiTrainingLevel: '',
        sbiStatusType: '',
        sbiIDType: '',
        sbiIDNumber: '',
        sbiSourceOfSchoolEnrollmentCountry: '',
        sbiSourceOfSchoolEnrollmentProvince: '',
        sbiSourceOfSchoolEnrollmentCity: '',
        sbiPolicyOutlook: '',
        sbiRegisteredResidencePlace: '',
        sbiFormerRegisteredResidenceProperty: '',
        sbiCellNumber: '',
        sbiEmail: '',
        sbiQq: '',
        sbiWechat: '',
        sbiLivingCountry: '',
        sbiLivingProvince: '',
        sbiLivingCity: '',
        sbiLivingDistrict: '',
        sbiLivingDetailedAddress: '',
        sbiRelativeName: '',
        sbiRelativeContract: '',
        sbiClass: '',
        sbiYouthLeagueBranch: '',
        sbiPartyBranch: '',
        sbiTeacher: '',
        sbiTeacherNumber: '',
        sbiClassTeacher: '',
        sbiClassTeacherNumber: '',
        sbiInstructor: '',
        sbiInstructorNumber: '',
        sbiOrganizer: '',
        sbiOrganizerNumber: '',
        sbiDean: '',
        sbiDeanNumber: '',
        sbiLivingAtSchool: '',
        sbiDormitoryCampus: '',
        sbiDormitoryBuilding: '',
        sbiDormitoryRoom: ''
      }
    }
  },
  computed: {
    currentUser() {
      return this.$store.state.account.user
    },
    avatar() {
      if (this.user.avatar) {
        return require(`@/assets/avatar/${this.user.avatar}`)
      } else {
        return require('@/assets/avatar/default.jpg')
      }
    }
  },
  mounted() {
    this.fetchId()
  },
  methods: {
    // 通过Token解析获得学号
    fetchId() {
      this.$get('achievement/award/getUserInfoByToken').then((r) => {
        this.stuID = r.data.data.studentBasicInfo.sbiNumber
        this.fetchStuInfo({ sbiNumber: this.stuID })
      })
    },
    // 根据学号获取基本信息
    fetchStuInfo(params = {}) {
      this.tableData = []
      this.$get('achievement/sbi/fetchSbiByNumber', {
        ...params
      }).then((r) => {
        const data = r.data.data
        this.sbiName = data.sbiName
        this.sbiNumber = data.sbiNumber
        this.sbiSex = data.sbiSex
        this.sbiAcademy = data.sbiAcademy
        this.sbiDepartment = data.sbiDepartment
        this.sbiMajor = data.sbiMajor
        this.tableData.push(
          {
            type: '出生日期',
            info: this.judgeNull(data.sbiBirthdate)
          },
          {
            type: '民族',
            info: this.judgeNull(data.sbiNation)
          },
          {
            type: '前置学历',
            info: this.judgeNull(data.sbiFormerEducation)
          },
          {
            type: '入学方式',
            info: this.judgeNull(data.sbiEntranceWay)
          },
          {
            type: '入学时间',
            info: this.judgeNull(data.sbiEntranceYear) + '-' + this.judgeNull(data.sbiEntranceMonth)
          },
          {
            type: '预计毕业时间',
            info: this.judgeNull(data.sbiPredictGraduateYear) + '-' + this.judgeNull(data.sbiPredictGraduateMonth)
          },
          {
            type: '学制',
            info: this.judgeNull(data.sbiEducationSystem)
          },
          {
            type: '培养层次',
            info: this.judgeNull(data.sbiTrainingLevel)
          },
          {
            type: '学籍类型',
            info: this.judgeNull(data.sbiStatusType)
          },
          {
            type: '身份证件类型',
            info: this.judgeNull(data.sbiIDType)
          },
          {
            type: '身份证件号',
            info: this.judgeNull(data.sbiIDNumber)
          },
          {
            type: '生源地国家',
            info: this.judgeNull(data.sbiSourceOfSchoolEnrollmentCountry)
          },
          {
            type: '生源地省',
            info: this.judgeNull(data.sbiSourceOfSchoolEnrollmentProvince)
          },
          {
            type: '生源地市',
            info: this.judgeNull(data.sbiSourceOfSchoolEnrollmentCity)
          },
          {
            type: '政治面貌',
            info: this.judgeNull(data.sbiPolicyOutlook)
          },
          {
            type: '户口所在地',
            info: this.judgeNull(data.sbiRegisteredResidencePlace)
          },
          {
            type: '入学前户口性质',
            info: this.judgeNull(data.sbiFormerRegisteredResidenceProperty)
          },
          {
            type: '手机号',
            info: this.judgeNull(data.sbiCellNumber)
          },
          {
            type: '电子信箱',
            info: this.judgeNull(data.sbiEmail)
          },
          {
            type: 'QQ号',
            info: this.judgeNull(data.sbiQq)
          },
          {
            type: '微信号',
            info: this.judgeNull(data.sbiWechat)
          },
          {
            type: '校外（家庭）居住国家',
            info: this.judgeNull(data.sbiLivingCountry)
          },
          {
            type: '校外（家庭）居住省',
            info: this.judgeNull(data.sbiLivingProvince)
          },
          {
            type: '校外（家庭）居住市',
            info: this.judgeNull(data.sbiLivingCity)
          },
          {
            type: '校外（家庭）居住区',
            info: this.judgeNull(data.sbiLivingDistrict)
          },
          {
            type: '校外（家庭）居住详细地址',
            info: this.judgeNull(data.sbiLivingDetailedAddress)
          },
          {
            type: '家属姓名',
            info: this.judgeNull(data.sbiRelativeName)
          },
          {
            type: '家属联系方式',
            info: this.judgeNull(data.sbiRelativeContract)
          },
          {
            type: '班级',
            info: this.judgeNull(data.sbiClass)
          },
          {
            type: '团支部',
            info: this.judgeNull(data.sbiYouthLeagueBranch)
          },
          {
            type: '党支部',
            info: this.judgeNull(data.sbiPartyBranch)
          },
          {
            type: '导师',
            info: this.judgeNull(data.sbiTeacher)
          },
          {
            type: '导师工号',
            info: this.judgeNull(data.sbiTeacherNumber)
          },
          {
            type: '班主任',
            info: this.judgeNull(data.sbiClassTeacher)
          },
          {
            type: '班主任工号',
            info: this.judgeNull(data.sbiClassTeacherNumber)
          },
          {
            type: '辅导员',
            info: this.judgeNull(data.sbiInstructor)
          },
          {
            type: '辅导员工号',
            info: this.judgeNull(data.sbiInstructorNumber)
          },
          {
            type: '组织员',
            info: this.judgeNull(data.sbiOrganizer)
          },
          {
            type: '组织员工号',
            info: this.judgeNull(data.sbiOrganizerNumber)
          },
          {
            type: '教务员',
            info: this.judgeNull(data.sbiDean)
          },
          {
            type: '教务员工号',
            info: this.judgeNull(data.sbiDeanNumber)
          },
          {
            type: '住校',
            info: this.judgeNull(data.sbiLivingAtSchool)
          },
          {
            type: '宿舍校区',
            info: this.judgeNull(data.sbiDormitoryCampus)
          },
          {
            type: '宿舍楼栋',
            info: this.judgeNull(data.sbiDormitoryBuilding)
          },
          {
            type: '宿舍房间号',
            info: this.judgeNull(data.sbiDormitoryRoom)
          }
        )
        this.changeStudentBaseInfoForm.sbiIndex = data.sbiIndex
        this.changeStudentBaseInfoForm.sbiNumber = data.sbiNumber
        this.changeStudentBaseInfoForm.sbiName = data.sbiName
        this.changeStudentBaseInfoForm.sbiSex = data.sbiSex
        this.changeStudentBaseInfoForm.sbiBirthdate = data.sbiBirthdate
        this.changeStudentBaseInfoForm.sbiNation = data.sbiNation
        this.changeStudentBaseInfoForm.sbiAcademy = data.sbiAcademy
        this.changeStudentBaseInfoForm.sbiDepartment = data.sbiDepartment
        this.changeStudentBaseInfoForm.sbiMajor = data.sbiMajor
        this.changeStudentBaseInfoForm.sbiFormerEducation = data.sbiFormerEducation
        this.changeStudentBaseInfoForm.sbiEntranceWay = data.sbiEntranceWay
        this.changeStudentBaseInfoForm.sbiEntranceYear = data.sbiEntranceYear
        this.changeStudentBaseInfoForm.sbiEntranceMonth = data.sbiEntranceMonth
        this.changeStudentBaseInfoForm.sbiEducationSystem = data.sbiEducationSystem
        this.changeStudentBaseInfoForm.sbiPredictGraduateYear = data.sbiPredictGraduateYear
        this.changeStudentBaseInfoForm.sbiPredictGraduateMonth = data.sbiPredictGraduateMonth
        this.changeStudentBaseInfoForm.sbiTrainingLevel = data.sbiTrainingLevel
        this.changeStudentBaseInfoForm.sbiStatusType = data.sbiStatusType
        this.changeStudentBaseInfoForm.sbiIDType = data.sbiIDType
        this.changeStudentBaseInfoForm.sbiIDNumber = data.sbiIDNumber
        this.changeStudentBaseInfoForm.sbiSourceOfSchoolEnrollmentCountry = data.sbiSourceOfSchoolEnrollmentCountry
        this.changeStudentBaseInfoForm.sbiSourceOfSchoolEnrollmentProvince = data.sbiSourceOfSchoolEnrollmentProvince
        this.changeStudentBaseInfoForm.sbiSourceOfSchoolEnrollmentCity = data.sbiSourceOfSchoolEnrollmentCity
        this.changeStudentBaseInfoForm.sbiPolicyOutlook = data.sbiPolicyOutlook
        this.changeStudentBaseInfoForm.sbiRegisteredResidencePlace = data.sbiRegisteredResidencePlace
        this.changeStudentBaseInfoForm.sbiFormerRegisteredResidenceProperty = data.sbiFormerRegisteredResidenceProperty
        this.changeStudentBaseInfoForm.sbiCellNumber = data.sbiCellNumber
        this.changeStudentBaseInfoForm.sbiEmail = data.sbiEmail
        this.changeStudentBaseInfoForm.sbiQq = data.sbiQq
        this.changeStudentBaseInfoForm.sbiWechat = data.sbiWechat
        this.changeStudentBaseInfoForm.sbiLivingCountry = data.sbiLivingCountry
        this.changeStudentBaseInfoForm.sbiLivingProvince = data.sbiLivingProvince
        this.changeStudentBaseInfoForm.sbiLivingCity = data.sbiLivingCity
        this.changeStudentBaseInfoForm.sbiLivingDistrict = data.sbiLivingDistrict
        this.changeStudentBaseInfoForm.sbiLivingDetailedAddress = data.sbiLivingDetailedAddress
        this.changeStudentBaseInfoForm.sbiRelativeName = data.sbiRelativeName
        this.changeStudentBaseInfoForm.sbiRelativeContract = data.sbiRelativeContract
        this.changeStudentBaseInfoForm.sbiClass = data.sbiClass
        this.changeStudentBaseInfoForm.sbiYouthLeagueBranch = data.sbiYouthLeagueBranch
        this.changeStudentBaseInfoForm.sbiPartyBranch = data.sbiPartyBranch
        this.changeStudentBaseInfoForm.sbiTeacher = data.sbiTeacher
        this.changeStudentBaseInfoForm.sbiTeacherNumber = data.sbiTeacherNumber
        this.changeStudentBaseInfoForm.sbiClassTeacher = data.sbiClassTeacher
        this.changeStudentBaseInfoForm.sbiClassTeacherNumber = data.sbiClassTeacherNumber
        this.changeStudentBaseInfoForm.sbiInstructor = data.sbiInstructor
        this.changeStudentBaseInfoForm.sbiInstructorNumber = data.sbiInstructorNumber
        this.changeStudentBaseInfoForm.sbiOrganizer = data.sbiOrganizer
        this.changeStudentBaseInfoForm.sbiOrganizerNumber = data.sbiOrganizerNumber
        this.changeStudentBaseInfoForm.sbiDean = data.sbiDean
        this.changeStudentBaseInfoForm.sbiDeanNumber = data.sbiDeanNumber
        this.changeStudentBaseInfoForm.sbiLivingAtSchool = data.sbiLivingAtSchool
        this.changeStudentBaseInfoForm.sbiDormitoryCampus = data.sbiDormitoryCampus
        this.changeStudentBaseInfoForm.sbiDormitoryBuilding = data.sbiDormitoryBuilding
        this.changeStudentBaseInfoForm.sbiDormitoryRoom = data.sbiDormitoryRoom
        this.loading = false
        console.log(this.tableData)
      })
    },
    judgeNull(obj) {
      if (obj === null) {
        return 'NULL'
      } else {
        return obj
      }
    },
    changeStudentBaseInfoSubmit() {
      axios({
        method: 'post',
        url: 'api/achievement/sbi/updateSbi',
        headers: { Authorization: 'bearer ' + getToken() },
        data: { ...this.changeStudentBaseInfoForm }
      }).then((r) => {
        // data = r.data
        this.fetchId()
        this.changeStudentBaseInfoFormVisible = false
      })
    }
  }
}

</script>
<style scoped>
.el-input__inner{
  style: "width:200px"
}
</style>
